import request from '@/utils/request'

//获取一级分类数据
export const reqGetCategory1Data = () => {
    return request.get('/admin/product/getCategory1')
}

//获取二级分类数据
export const reqGetCategory2Data = (category1Id) => {
    return request.get(`/admin/product/getCategory2/${category1Id}`)
}

//获取三级分类数据
export const reqGetCategory3Data = (category2Id) => {
    return request.get(`/admin/product/getCategory3/${category2Id}`)
}

//根据三级导航来获取属性列表数据
export const reqGetAttrListDataByCategory3Id = ({ category1Id, category2Id, category3Id }) => {
    return request.get(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)
}

//添加属性
export const reqAddAttrInfo = (attrInfo) => {
    return request.post('/admin/product/saveAttrInfo', attrInfo)
}

///admin/product/deleteAttr/{attrId}

//删除属性
export const reqDeleteAttrInfo = (attrId) => {
    return request.delete(`/admin/product/deleteAttr/${attrId}`)
}